package pl.skubicha.response;

import java.io.Serializable;
import java.util.HashSet;
import java.util.Set;

import javax.validation.constraints.Size;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.hibernate.validator.constraints.Email;
import org.hibernate.validator.constraints.NotEmpty;

import pl.skubicha.domain.Groups;
import pl.skubicha.domain.PartialGrades;
import pl.skubicha.domain.Roles;
import pl.skubicha.domain.Subjects;

public class UserDTO implements Serializable {

	private static final long serialVersionUID = -5488702255320352709L;

	private Integer id;

	@Size(min=1, message="Pole nie może być puste! ")
	private String firstName;
	
	@Size(min=1, message="Pole nie może być puste! ")
	private String lastName;

	@Size(min=1, message="Pole nie może być puste! ")
	private String userName;

	@Email(message="Nieprawidłowy adres email!")
	@NotEmpty(message="Pole nie może być puste!")
	private String email;

	@Size(min=1, message="Pole nie może być puste! ")
	private String password;

	private String newPassword;
	private String rePassword;

	private Integer albumNumber;

	private Groups groups;

	private Roles roles;

	private boolean status;

	private Set< Subjects > subjects = new HashSet< Subjects >( 0 );
	private Set< PartialGrades > grades = new HashSet< PartialGrades >( 0 );

	public Integer getId() {
		return id;
	}

	public void setId( final Integer id ) {
		this.id = id;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName( final String userName ) {
		this.userName = userName;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName( final String firstName ) {
		this.firstName = firstName;
	}

	public String getLastName() {
		return lastName;
	}

	public void setLastName( final String lastName ) {
		this.lastName = lastName;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail( final String email ) {
		this.email = email;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword( final String password ) {
		this.password = password;
	}

	public String getNewPassword() {
		return newPassword;
	}

	public void setNewPassword( final String newPassword ) {
		this.newPassword = newPassword;
	}

	public String getRePassword() {
		return rePassword;
	}

	public void setRePassword( final String rePassword ) {
		this.rePassword = rePassword;
	}

	public Roles getRoles() {
		return roles;
	}

	public void setRoles( final Roles roles ) {
		this.roles = roles;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus( final boolean status ) {
		this.status = status;
	}

	public Integer getAlbumNumber() {
		return albumNumber;
	}

	public void setAlbumNumber( final Integer albumNumber ) {
		this.albumNumber = albumNumber;
	}

	public String getGroupFullName() {
		return getGroups().getGroupFullName();
	}

	public Groups getGroups() {
		return groups;
	}

	public void setGroups( final Groups groups ) {
		this.groups = groups;
	}

	@Override
	public String toString() {
		return ReflectionToStringBuilder.toString( this );
	}

	public Set< Subjects > getSubjects() {
		return subjects;
	}

	public void setSubjects( final Set< Subjects > subjects ) {
		this.subjects = subjects;
	}

	public Set< PartialGrades > getGrades() {
		return grades;
	}

	public void setGrades( Set< PartialGrades > grades ) {
		this.grades = grades;
	}

}
